import java.util.Scanner;
public class SSS {
    public static void main(String[] args){
        System.out.println("输入正方形长");
        int i;
        Scanner A=new Scanner(System.in);
        i=A.nextInt();
        for(int o =0;o<i;o++){
            System.out.print("*");
        }
        System.out.println();
        for(int p=2;p<i;p++){
            System.out.print("*");

            for(int u=2;u<i;u++){
                System.out.print(" ");
        }System.out.print("*");
            System.out.println();
        }
        for(int o =0;o<i;o++){
            System.out.print("*");
        }
    }
}


